﻿//==============================================================================  
//Copyright (C) 2012-2015 9UN.ORG. All rights reserved. 
//GUID：7c17e58d-dc8b-4ef6-9ce9-4a37bf28566f
//CLR Version: 4.0.30319.18033
//Code Author：Kevin Wang
//Contact：Email(Admin@9un.org),QQ(265382 or 74344)
//Filename：VideoAspectRatioConst
//Namespace：RuanRang.Media.Core.Common
//Functions：VideoAspectRatioConst  
//Created by Kevin Wang at 2013/3/3 13:07:43 http://blog.9un.org
//============================================================================== 

using System.Collections.Generic;

namespace RuanRang.Media.Core.Common
{
    public static class VideoAspectRatioList
    {
        private const string Default = "Default";
        private const string AR1To1 = "1:1";
        private const string AR4To3 = "4:3";
        private const string AR16To9 = "16:9";
        private const string AR16To10 = "16:10";
        private const string AR2X21To1 = "2.21:1";
        private const string AR2X35To1 = "2.35:1";
        private const string AR2X39To1 = "2.39:1";
        private const string AR5To4 = "5:4";
        private static readonly Dictionary<VideoAspectRatioType, string> VideoAspectRatioDict;

        /// <summary>
        /// Initializes static members of the <see cref="VideoAspectRatioList"/> class.
        /// </summary>
        static VideoAspectRatioList()
        {
            VideoAspectRatioDict = new Dictionary<VideoAspectRatioType, string>
                                       {
                                           {VideoAspectRatioType.Default, Default},
                                           {VideoAspectRatioType.AR1To1, AR1To1},
                                           {VideoAspectRatioType.AR4To3, AR4To3},
                                           {VideoAspectRatioType.AR16To9, AR16To9},
                                           {
                                               VideoAspectRatioType.AR16To10,
                                               AR16To10
                                           },
                                           {
                                               VideoAspectRatioType.AR2_21To1,
                                               AR2X21To1
                                           },
                                           {
                                               VideoAspectRatioType.AR2_35To1,
                                               AR2X35To1
                                           },
                                           {
                                               VideoAspectRatioType.AR2_39To1,
                                               AR2X39To1
                                           },
                                           {VideoAspectRatioType.AR5To4, AR5To4}
                                       };
        }

        /// <summary>
        /// Gets the <see cref="System.String" /> with the specified type.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <returns>System.String.</returns>
        public static string Get(VideoAspectRatioType type)
        {
            return VideoAspectRatioDict.ContainsKey(type) ? VideoAspectRatioDict[type] : Default;
        }
    }
}
